Continuation analysis tasks for GPU task scheduling

ABSTRACT

Systems, apparatuses, and methods for implementing continuation analysis tasks (CATs) are disclosed. In one embodiment, a system implements hardware acceleration of CATs to manage the dependencies and scheduling of an application composed of multiple tasks. In one embodiment, a continuation packet is referenced directly by a first task. When the first task completes, the first task enqueues a continuation packet on a first queue. The first task can specify on which queue to place the continuation packet. The agent responsible for the first queue dequeues and executes the continuation packet which invokes an analysis phase which is performed prior to determining which dependent tasks to enqueue. If it is determined during the analysis phase that a second task is now ready to be launched, the second task is enqueued on one of the queues. Then, an agent responsible for this queue dequeues and executes the second task.

CROSS REFERENCE TO RELATED

This application is a continuation of U.S. patent application Ser. No.15/607,991, now U.S. Pat. No. 10,620,994, entitled “CONTINUATIONANALYSIS TASKS FOR GPU TASK SCHEDULING”, filed May 30, 2017, theentirety of which is incorporated herein by reference.

BACKGROUND Description of the Related Art

Task parallel applications are becoming increasingly popular in thehigh-performance computing (HPC) domain because of their ability toeffectively utilize parallel execution resources. However, one of thechallenges with task parallel applications is efficiently managingdependencies. Current dependency tracking and resolution methods, suchas the heterogeneous system architecture's (HSA's) architected queuinglanguage (AQL) barrier packets or software-managed centralizeddependency tracking tables, are not efficient. Specifically, while AQLbarrier packets are directly executed by a graphic processing unit's(GPU's) command processors, the packets themselves can block task queuesand necessitate careful queue management. Meanwhile, current softwaredependency tracking solutions require the host central processing unit(CPU) threads to get involved in GPU scheduling, which preventslow-latency dispatch of dependent tasks. In addition, some softwaredependency tracking solutions use centralized tracking tables that donot scale.

BRIEF DESCRIPTION OF THE DRAWINGS

The advantages of the methods and mechanisms described herein may bebetter understood by referring to the following description inconjunction with the accompanying drawings, in which:

FIG. 1 is a block diagram of one embodiment of a computing system.

FIG. 2 is a block diagram of another embodiment of a computing system.

FIG. 3 is a generalized flow diagram illustrating one embodiment of amethod for implementing continuation analysis tasks (CATs).

FIG. 4 is a generalized flow diagram illustrating another embodiment ofa method for implementing CATs.

FIG. 5 is a generalized flow diagram illustrating another embodiment ofa method for implementing CATs.

FIG. 6 is a generalized flow diagram illustrating another embodiment ofa method for implementing CATs.

FIG. 7 is a generalized flow diagram illustrating another embodiment ofa method for implementing CATs.

FIG. 8 is a generalized flow diagram illustrating one embodiment of amethod for a CAT specifying a CPU task.

FIG. 9 is a generalized flow diagram illustrating one embodiment of amethod for handling kernel completion.

DETAILED DESCRIPTION OF EMBODIMENTS

In the following description, numerous specific details are set forth toprovide a thorough understanding of the methods and mechanisms presentedherein. However, one having ordinary skill in the art should recognizethat the various embodiments may be practiced without these specificdetails. In some instances, well-known structures, components, signals,computer program instructions, and techniques have not been shown indetail to avoid obscuring the approaches described herein. It will beappreciated that for simplicity and clarity of illustration, elementsshown in the figures have not necessarily been drawn to scale. Forexample, the dimensions of some of the elements may be exaggeratedrelative to other elements.

Systems, apparatuses, and methods for implementing continuation analysistasks (CATs) are disclosed herein. In one embodiment, a system includesa plurality of command processors, a plurality of queues, and aplurality of compute units. In one embodiment, the system is configuredto implement hardware acceleration of CATs that are designed to handlethe dependencies and scheduling of an application composed of multipletasks. A CAT can be referenced directly by the data structure thatspecifies its parent task, by an AQL packet, or the CAT can be tied to asignal.

In various embodiments, the command processors are configured to launcha plurality of threads on the plurality of compute units, wherein agiven task can include multiple threads. When a first task completes,the first task enqueues a continuation packet on a given queue. In oneembodiment, the first task specifies on which queue to place thecontinuation packet. At a later point in time, a command processordequeues the continuation packet and performs one or more actionsspecified by the continuation packet. An action that is specified by thecontinuation packet can be referred to herein as a “task”. In oneembodiment, if the task is a fixed function action, then the packet isan agent dispatch packet that includes a code which indicates whichfixed function to perform. The fixed function can be performed bydedicated hardware or microcode, or the fixed function could beimplemented by a software emulated queue on a CPU. If the task is anapplication action, then the packet is a kernel dispatch packet thatreferences a kernel that performs the task. In other embodiments, othertypes of packets can be utilized.

In another embodiment, when the first task completes, an interrupt isgenerated to launch a continuation action. For example, in thisembodiment, when the first task completes, the first task generates aninterrupt to a given hardware unit that will respond with an actionspecified by the payload of the interrupt. The action can involvelaunching an analysis task, performing a fixed function, and/or othertasks.

When the continuation packet launches a CAT to perform an analysisphase, the specific types of actions that are performed during theanalysis phase can vary from embodiment to embodiment. In oneembodiment, the analysis phase can include determining which tasks areready to be launched now that the first task has been completed. If itis determined during the analysis phase that a second task, which isdependent on the first task, is ready to be launched, the second packet,corresponding to the second task, is enqueued on a specified queue ofthe plurality of queues. Then, a command processor dequeues and executesthe second packet which launches the second task. In another embodiment,the analysis phase can result in determining that a plurality of tasksare now ready to be launched, and a plurality of packets can be enqueuedon specified queues to cause these plurality of tasks to be launched.

Referring now to FIG. 1 , a block diagram of one embodiment of acomputing system 100 is shown. In one embodiment, computing system 100includes system on chip (SoC) 105 coupled to memory 180. SoC 105 canalso be referred to as an integrated circuit (IC). In one embodiment,SoC 105 includes processing units 175A-N of central processing unit(CPU) 165, input/output (I/O) interfaces 155, caches 160A-B, fabric 120,graphics processing unit (GPU) 130, local memory 110, and memorycontroller(s) 150. SoC 105 can also include other components not shownin FIG. 1 to avoid obscuring the figure. Processing units 175A-N arerepresentative of any number and type of processing units. In oneembodiment, processing units 175A-N are CPU cores. In anotherembodiment, one or more of processing units 175A-N are other types ofprocessing units (e.g., application specific integrated circuit (ASIC),field programmable gate array (FPGA), digital signal processor (DSP)).Processing units 175A-N of CPU 165 are coupled to caches 160A-B andfabric 120.

In one embodiment, processing units 175A-N are configured to executeinstructions of a particular instruction set architecture (ISA). Eachprocessing unit 175A-N includes one or more execution units, cachememories, schedulers, branch prediction circuits, and so forth. In oneembodiment, the processing units 175A-N are configured to execute themain control software of system 100, such as an operating system.Generally, software executed by processing units 175A-N during use cancontrol the other components of system 100 to realize the desiredfunctionality of system 100. Processing units 175A-N can also executeother software, such as application programs.

In one embodiment, GPU 130 is configured to execute graphics pipelineoperations such as draw commands, pixel operations, geometriccomputations, rasterization operations, and other operations forrendering an image to a display. In another embodiment, GPU 130 isconfigured to execute operations unrelated to graphics. In a furtherembodiment, GPU 130 is configured to execute both graphics operationsand non-graphics related operations.

GPU 130 includes at least command processors 135A-N, hardware queues140A-N, and compute units 145A-N. It should be understood that thenumber of command processors can be different than the number ofhardware queues as well as different from the number of compute units.It should also be understood that the appearance of a one-to-onecorrespondence between command processor, hardware queue, and computeunit is not necessary and is shown merely for ease of illustration.Command processors 135A-N are representative of any number and type ofcommand processors for retrieving and executing packets from hardwarequeues 140A-N. In one embodiment, a “packet” is defined as a memorybuffer encoding a single command. Different types of packets can bestored in hardware queues 140A-N. For example, a packet for dispatchinga kernel is referred to as a “kernel dispatch packet”.

Compute units 145A-N are representative of any number and type ofcompute units that are used for graphics or general-purpose processing.Each compute unit 145A-N includes any number of execution units, withthe number of execution units per compute unit varying from embodimentto embodiment. In some embodiments, compute units may be virtual (e.g.,virtual machines). Various such embodiments are possible and arecontemplated. GPU 130 is coupled to local memory 110 and fabric 120. Inone embodiment, local memory 110 is implemented using high-bandwidthmemory (HBM). The combination of local memory 110 and memory 180 can bereferred to herein as a “memory subsystem”. Alternatively, either localmemory 110 or memory 180 can be referred to herein as a “memorysubsystem”.

In one embodiment, a first task specifies a continuation packet to beenqueued on a specified queue when the first task completes execution.It is noted that a “task” can also be referred to as a “kernel”. As usedherein, the term “continuation packet” is defined as a unit of dataencoding one or more commands and/or a pointer to executable code. Inone embodiment, a “continuation packet” is defined as a packet which isenqueued on a specified queue in response to a first task completing,with the packet causing one or more continuation actions to be performedin response to being dequeued from the specified queue. A packet whichlaunches the first task, when the packet is dequeued, can be referred toherein as an “ordinary packet” to differentiate from a “continuationpacket”. In one embodiment, an ordinary packet contains or references acontinuation packet and a target queue ID. When the task specified inthe ordinary packet completes, the continuation packet willautomatically be enqueued on the target queue.

When the first task is completed, the continuation packet is enqueued onone of hardware queues 140A-N. The continuation packet can also beenqueued on AQL queues of other agents, including an AQL queue of CPU165. It is noted that an AQL queue can be mapped to a hardware queue bythe scheduler. In one embodiment, the first task specifies whichhardware queue of hardware queues 140A-N for enqueuing the continuationpacket. Then, after the continuation packet is enqueued, a commandprocessor of command processors 135A-N dequeues and executes thecontinuation packet. In one embodiment, the continuation packet launchesa CAT which performs one or more functions prior to enqueuing a secondtask on one of hardware queues 140A-N. These function(s) performactions, which can include enqueuing further tasks. These function(s)can also perform other types of actions, such as atomically updatingglobal memory data structures that are inspected by future CATs. In oneembodiment, the CAT determines if all dependencies have been satisfiedto allow the second task and any additional tasks to be executed.

In another embodiment, the CAT determines the current workload ofcompute units 145A-N and/or processing units 175A-N (of CPU 165) andassigns the second task and any additional tasks to specific queue(s)with the goal of balancing the load across compute units 145A-N and/orprocessing units 175A-N. It is noted that the given queue will beprocessed by a command processor that is responsible for dispatchingkernels on a specific compute unit or processing unit. In a furtherembodiment, the CAT determines which tasks are on the critical path, andthen the CAT causes the tasks to be enqueued in an order based onprioritizing tasks which are on the critical path.

I/O interfaces 155 are coupled to fabric 120, and I/O interfaces 155 arerepresentative of any number and type of interfaces (e.g., peripheralcomponent interconnect (PCI) bus, PCI-Extended (PCI-X), PCIE (PCIExpress) bus, gigabit Ethernet (GBE) bus, universal serial bus (USB)).Various types of peripheral devices can be coupled to I/O interfaces155. Such peripheral devices include (but are not limited to) displays,keyboards, mice, printers, scanners, joysticks or other types of gamecontrollers, media recording devices, external storage devices, networkinterface cards, and so forth.

SoC 105 is coupled to memory 180, which includes one or more memorymodules. Each of the memory modules includes one or more memory devicesmounted thereon. In some embodiments, memory 180 includes one or morememory devices mounted on a motherboard or other carrier upon which SoC105 is also mounted. In one embodiment, memory 180 is used to implementa random access memory (RAM) for use with SoC 105 during operation. TheRAM implemented can be static RAM (SRAM), dynamic RAM (DRAM), ResistiveRAM (ReRAM), Phase Change RAM (PCRAM), or any other volatile ornon-volatile RAM. The type of DRAM that is used to implement memory 180includes (but is not limited to) double data rate (DDR) DRAM, DDR2 DRAM,DDR3 DRAM, and so forth. Although not explicitly shown in FIG. 1 , SoC105 can also include one or more cache memories that are internal to theprocessing units 175A-N and/or compute units 145A-N. In someembodiments, SoC 105 includes caches 160A-B that are utilized byprocessing units 175A-N. It is noted that caches 160A-B arerepresentative of any number of caches that can be included in SoC 105.In one embodiment, caches 160A-B are part of a cache subsystem includinga cache controller.

It is noted that the letter “N” when displayed herein next to variousstructures is meant to generically indicate any number of elements forthat structure (e.g., any number of processing units 175A-N in CPU 165,including one processing unit). Additionally, different referenceswithin FIG. 1 that use the letter “N” (e.g., compute units 145A-N) arenot intended to indicate that equal numbers of the different elementsare provided (e.g., the number of processing units 175A-N in CPU 165 candiffer from the number of compute units 145A-N of GPU 130).

In various embodiments, computing system 100 can be a computer, laptop,mobile device, server or any of various other types of computing systemsor devices. It is noted that the number of components of computingsystem 100 and/or SoC 105 can vary from embodiment to embodiment. Therecan be more or fewer of each component/subcomponent than the numbershown in FIG. 1 . It is also noted that computing system 100 and/or SoC105 can include other components not shown in FIG. 1 . Additionally, inother embodiments, computing system 100 and SoC 105 can be structured inother ways than shown in FIG. 1 .

Turning now to FIG. 2 , a block diagram of another embodiment of acomputing system 200 is shown. Computing system 200 includes at leastGPU 210, CPU 215, and memory 220. Memory 220 is representative of anynumber and type of memory devices accessible by GPU 210 and CPU 215.Command processors 240A-N are representative of any number and type ofcommand processors. In one embodiment, each command processor 240A-N isequivalent to the other command processors 240A-N. In anotherembodiment, different types of command processors are included amongcommand processors 240A-N. Each command processor 240A-N is configuredto retrieve a packet from a corresponding set of queues 230A-N andprocess the packet. If the packet is a kernel dispatch packet, thencommand processor 240A-N is configured to initiate the kernel on one ormore of compute units 245A-N.

Compute units 245A-N are representative of any number and type ofcompute units. Each compute unit 245A-N includes any number of executionunits, with the number of execution units varying from embodiment toembodiment. In one embodiment, each compute unit 245A-N includes or iscoupled to a corresponding cache 250A-N. Also, compute units 245A-N arecoupled to a shared cache 255. In other embodiments, compute units245A-N can access other types of caches structures and/or memorysubsystems.

Queues 230A-N are representative of any number and type of queues whichare allocated in memory 220. Each set of queues 230A-N includes anynumber of queues. In one embodiment, the packets stored in each queue ofqueues 230A-N are processed in order. Accordingly, in this embodiment,each queue of queues 230A-N is treated as a first-in, first-out (FIFO)queue. In one embodiment, different ones of queues 230A-N are configuredto store different types of packets. A packet is a memory bufferencoding one or more commands, and the packet can also include a pointerto executable code stored elsewhere in memory 220. In one embodiment, apacket (e.g., an AQL packet) includes a single command.

In one embodiment, each queue 230A-N is assigned to a separate one ofcommand processors 240A-N. For example, in this embodiment, packetsstored in queues 230A are retrieved and processed by command processor240A, packets stored in queues 230B are retrieved and processed bycommand processor 240B, and so on. Additionally, in one embodiment, oneor more of the sets of queues 230A-N are monitored by a commandprocessor which dispatches tasks to CPU 215.

When a given task finishes execution on system 200, the given task canenqueue a continuation packet. The given task references thecontinuation packet and specifies the queue of queues 230A-N on whichthe continuation packet should be enqueued. Then, in one embodiment, aCAT will be launched when the continuation packet is processed by theagent responsible for the queue storing the continuation packet.Depending on the embodiment, the CAT can initiate one or more functionswhen the continuation packet is selected out of the queue by acorresponding command processor 240A-N. In one embodiment, the CATdetermines which tasks are ready to execute now that the previous taskhas been completed. For example, in this embodiment, the CAT can checkfor various dependencies and determine if any tasks are ready toexecute. If the CAT determines that a given task is now ready to beexecuted, the CAT enqueues the given task on an appropriate queue ofqueues 230A-N.

In another embodiment, the CAT executes an analysis phase. For example,the CAT can perform a load balancing analysis to determine the state ofthe system and determine on which of the compute units and/or CPU adependent task should be executed based on the state of the system. Inother embodiments, the CAT can initiate other types of functions.

In a further embodiment, a CAT is identified by the original task, andwhen the original task is completed, an interrupt is generated to startthe identified CAT. In this embodiment, the CAT is stored in a locationin memory 220, and the interrupt includes a pointer to the address ofthe CAT.

Referring now to FIG. 3 , one embodiment of a method 300 forimplementing continuation analysis tasks (CATs) is shown. For purposesof discussion, the steps in this embodiment and those of FIGS. 4-8 areshown in sequential order. However, it is noted that in variousembodiments of the described methods, one or more of the elementsdescribed are performed concurrently, in a different order than shown,or are omitted entirely. Other additional elements are also performed asdesired. Any of the various systems or apparatuses described herein areconfigured to implement method 300.

A system executes a first task on one or more compute units (block 305).The first task specifies a continuation packet and a first queue onwhich to enqueue the continuation packet when the first task completes(block 310). The system enqueues the continuation packet on the firstqueue responsive to completing the first task (block 315). In oneembodiment, the system includes a plurality of compute units, one ormore command processors, and a plurality of queues. In one embodiment,for a given queue, the packets stored on the given queue are processedin order by a corresponding command processor. However, packets enqueuedon different queues are not necessarily processed in order with respectto packets on other queues. Next, a first command processor dequeues thecontinuation packet from the first queue (block 320). Then, the firstcommand processor executes the continuation packet to launch acontinuation analysis task (CAT) which enqueues one or more tasks on oneor more different queues as part of executing one or more functions,wherein the one or more tasks are dependent on the first task (block325). It is noted that a continuation packet that causes a CAT to belaunched can also be referred to as a “CAT packet”. In one embodiment,the CAT discovers that multiple tasks have been unblocked and attemptsto enqueue all of these tasks, with each task possibly being enqueued ona different queue. In general, the one or more tasks can include asecond task which is enqueued on a given queue. In one embodiment, thegiven queue is different from the first queue. In another embodiment,the given queue is the same queue as the first queue. In one embodiment,the CAT identifies a specific queue for enqueuing the second task. Afterblock 325, method 300 ends.

In one embodiment, the one or more functions performed by the CATinclude determining if one or more dependencies have been satisfiedwhich allow the second task (and optionally one or more other tasks) tobe enqueued on the given queue. In this embodiment, the first commandprocessor is configured to enqueue the second task on the given queueresponsive to determining that the one or more dependencies have beensatisfied. In another embodiment, the one or more functions performed bythe CAT include determining a load balance status of the plurality ofcompute units and selecting a queue, which corresponds to a givencompute unit, for enqueuing the second task responsive to determining aload on the given compute unit is below a threshold.

Turning now to FIG. 4 , another embodiment of a method 400 forimplementing continuation analysis tasks (CATs) is shown. A first taskexecutes on one or more compute units of a system (block 405). In oneembodiment, the system includes a plurality of compute units, one ormore command processors, and a plurality of queues. Also, the first taskspecifies a continuation analysis task (CAT) which should be executedwhen the first task completes (block 410). Then, an interrupt isgenerated to launch the CAT responsive to the first task completing(block 415). In response to the interrupt being generated, a commandprocessor executes the CAT (block 420). Then, the CAT enqueues a secondtask on a given queue as part of performing one or more functions,wherein the second task is dependent on the first task (block 425). Insome embodiments, the CAT enqueues multiple tasks on one or more queues.After block 425, method 400 ends.

Referring now to FIG. 5 , another embodiment of a method 500 forimplementing continuation analysis tasks (CATs) is shown. A commandprocessor maps a set of GPU task queues to the available hardware queueslots (block 505). The set of GPU task queues can include any number oftask queues. In one embodiment, each task queue is monitored by acorresponding command processor of a plurality of command processors.Next, a command processor processes a first packet which causes a kernelto be launched (block 510). In one embodiment, the first packet is anarchitected queuing language (AQL) packet.

Then, at a later point in time, when the kernel completes, the kernelspecifies a continuation packet and where to enqueue the continuationpacket (block 515). Next, a command processor dequeues and executes thecontinuation packet (block 520). The continuation packet invokes akernel that performs a continuation analysis task (CAT) to enqueue oneor more second packets (block 525). In one embodiment, the commandprocessor is a thread running on a multithreaded command processor. Thecommand processor is tightly integrated within the GPU memory system andthe GPU's task scheduling and completion interfaces. Accordingly,executing the CATs on the CP is more efficient than performing similarfunctionality on the CPU host. After block 525, method 500 ends.

Turning now to FIG. 6 , another embodiment of a method 600 forimplementing continuation analysis tasks (CATs) is shown. A commandprocessor maps a set of GPU task queues to the available hardware queueslots (block 605). The set of GPU task queues can include any number oftask queues. In one embodiment, each task queue is monitored by acorresponding command processor of a plurality of command processors.Next, a command processor processes a first packet which causes a kernelto be launched (block 610).

Then, at a later point in time, the kernel completes and specifies acontinuation packet and where to enqueue the continuation packet (block615). Then, at a later point in time, a command processor dequeues andexecutes the continuation packet which launches a continuation analysistask (CAT) to evaluate dependency logic for dependent task(s) (block620). If all of the dependencies for the dependent task(s) have beenresolved (conditional block 625, “yes” leg), then a command processorenqueues the dependent task(s) on specified queue(s) (block 630).Otherwise, if not all of the dependencies for the dependent task(s) havebeen resolved (conditional block 625, “no” leg), then the CAT completeswithout enqueuing the dependent task(s) (block 635). After blocks 630and 635, method 600 ends.

Referring now to FIG. 7 , another embodiment of a method 700 forimplementing continuation analysis tasks (CATs) is shown. A commandprocessor maps a set of GPU task queues to the available hardware queueslots (block 705). The set of GPU task queues can include any number oftask queues. In one embodiment, each task queue is monitored by acorresponding command processor of a plurality of command processors.Next, a command processor processes a first packet which causes a kernelto be launched (block 710).

Then, at a later point in time, the kernel completes and specifies acontinuation packet and where to enqueue the continuation packet (block715). Then, at a later point in time, a command processor dequeues andexecutes the continuation packet which launches a continuation analysistask (CAT) to evaluate dependency logic for multiple dependent tasks(block 720). If multiple tasks are waiting for futures produced by thistask (conditional block 725, “yes” leg), then a command processorenqueues the dependent tasks on specified queues depending on theirdistance from a final task of the application (block 730). In oneembodiment, the command processor executes the CAT to optimize the orderin which the dependent tasks are enqueued by evaluating the distanceeach dependent task is from the exit node (i.e., last task) in the taskdependency graph or portion of the task dependency graph. By comparingdistances from the exit node, the CAT determines which dependent tasksare on the critical path to complete the application and prioritizesthese dependent tasks. In one embodiment, the CAT reads GPU performancecounters and enqueues the dependent tasks depending on the cachelocality of prior tasks.

Otherwise, if there are not multiple tasks waiting for futures producedby this task (conditional block 725, “no” leg), then the CAT completesand enqueues any tasks whose dependencies have been satisfied (block735). After blocks 730 and 735, method 700 ends. In one embodiment ofmethod 700, the CAT evaluates application specific “futures”. Futures isa well-known parallel programming concept that was initially introducedin functional programming. Essentially a future is a proxy for a resultthat is initially unknown and applications use futures to identify datadependencies between tasks. Once the future variable is produced by theparent task, the child task waiting for the future can proceed. Inaddition, multiple tasks can depend on a shared future, thus a CATgenerated for the command processor could create and enqueue multiplechildren tasks which depend on the shared future.

Turning now to FIG. 8 , one embodiment of a method 800 for a CATspecifying a CPU task is shown. A command processor maps a set of GPUtask queues to the available hardware queue slots (block 805). In oneembodiment, each GPU task queue is allocated in memory, and the commandprocessor determines the address of each GPU task queue in block 805.Next, the command processor processes a first packet which causes akernel specified by the first packet to be launched (block 810).

When the kernel completes, the kernel specifies a continuation packetand where to enqueue the continuation packet (block 815). Then, a CPUthread dequeues and executes the continuation packet to enqueue a CPUtask onto a CPU software queue (block 820). After block 820, method 800ends. In one embodiment of method 800, the continuation packet causes aCPU task to be launched that analyzes the results generated by the GPU.In other embodiments, the continuation packet can cause tasks to belaunched on other devices, such as other GPUs, DSPs, FPGAs, ASICs, orother devices.

Referring now to FIG. 9 , one embodiment of a method 900 for handlingkernel completion is shown. A command processor processes a first AQLpacket to launch a kernel (block 905). The kernel completes and thecommand processor enqueues a CAT packet associated with the first AQLpacket on an AQL queue specified by the first AQL packet (block 910).The CAT packet and the AQL queue the CAT packet is put on can be anyqueue, including a queue processed by the GPU or CPU. The execution ofthe CAT, which can be any packet, can evaluate the dependencies, and ifsatisfied can enqueue additional AQL packets on the AQL queues that canexecute them. This allows the completion of GPU packets to havedependencies that result on more GPU packets being evaluated on the GPU,while also allowing dependencies that result in CPU notification to beexecuted on the CPU. The computation to perform for dependence analysiscan be any action ranging from a fully general kernel, to dedicatedpackets processed by an agent dispatch AQL queue implemented on the GPUor CPU. After block 910, method 900 ends.

In various embodiments, program instructions of a software applicationare used to implement the methods and/or mechanisms previouslydescribed. The program instructions describe the behavior of hardware ina programming language, such as C. Alternatively, a hardware designlanguage (HDL) is used, such as Verilog. The program instructions arestored on a non-transitory computer readable storage medium. Numeroustypes of storage media are available. The storage medium is accessibleby a computing system during use to provide the program instructions andaccompanying data to the computing system for program execution. Thecomputing system includes at least one or more memories and one or moreprocessors configured to execute program instructions.

It should be emphasized that the above-described embodiments are onlynon-limiting examples of implementations. Numerous variations andmodifications will become apparent to those skilled in the art once theabove disclosure is fully appreciated. It is intended that the followingclaims be interpreted to embrace all such variations and modifications.

What is claimed is:
 1. An apparatus comprising: a command processor; anda plurality of queues; wherein the apparatus is configured to: enqueue acontinuation packet on a first queue of the plurality of queues based atleast in part on completion of a first task, wherein the first taskidentifies the first queue for enqueuing the continuation packet; anddequeue and execute, by the command processor, the continuation packetto launch a continuation analysis task to perform one or more functionsprior to a second task that is dependent on the first task beingenqueued on a second queue.
 2. The apparatus as recited in claim 1,wherein the command processor is configured to determine if one or moredependencies have been satisfied which allow the second task to beenqueued on the second queue.
 3. The apparatus as recited in claim 2,wherein the command processor is configured to enqueue the second taskon the second queue based at least in part on a determination that theone or more dependencies have been satisfied.
 4. The apparatus asrecited in claim 1, wherein the command processor is integrated within agraphics processing unit.
 5. The apparatus as recited in claim 1,wherein the one or more functions comprise selecting a first computeunit for execution of the second task based at least in part on a loadof the first compute unit.
 6. The apparatus as recited in claim 1,wherein tasks stored on each queue of the plurality of queues areprocessed in order.
 7. A method comprising: enqueuing a continuationpacket on a first queue, responsive to completion of a first task on oneor more compute units, wherein the first task identifies the first queuefor enqueuing the continuation packet; and dequeuing and executing, by acommand processor, the continuation packet to launch a continuationanalysis task to perform one or more functions prior to a second taskthat is dependent on the first task being enqueued on a second queue. 8.The method as recited in claim 7, further comprising the commandprocessor determining if one or more dependencies have been satisfiedwhich allow the second task to be enqueued on the second queue.
 9. Themethod as recited in claim 8, further comprising the command processorenqueuing the second task on the second queue responsive to determiningthat the one or more dependencies have been satisfied.
 10. The method asrecited in claim 9, wherein the continuation analysis task identifiesthe second queue for enqueuing the second task.
 11. The method asrecited in claim 7, further comprising the first task selecting a firstcompute unit to execute the second task based at least in part on a loadbalance status of a plurality of compute units.
 12. The method asrecited in claim 7, wherein packets stored on the first queue areprocessed in order.
 13. A system comprising: one or more compute units;one or more command processors; and a plurality of queues; wherein thesystem is configured to: enqueue a continuation packet on a first queuebased at least in part on completion of a first task on one or morecompute units, wherein the first task identifies the first queue forenqueuing the continuation packet; and dequeue and execute, by a commandprocessor, the continuation packet to launch a continuation analysistask to perform one or more functions prior to a second task that isdependent on the first task being enqueued on a second queue.
 14. Thesystem as recited in claim 13, wherein the command processor isconfigured to determine if one or more dependencies have been satisfiedwhich allow the second task to be enqueued on the second queue.
 15. Thesystem as recited in claim 14, wherein the command processor isconfigured to enqueue the second task on the second queue based at leastin part on a determination that the one or more dependencies have beensatisfied.
 16. The system as recited in claim 15, wherein thecontinuation analysis task identifies the second queue for enqueuing thesecond task.
 17. The system as recited in claim 13, wherein the firsttask is configured to select a first compute unit to execute the secondtask based at least in part on a load balance status of a plurality ofcompute units.
 18. The system as recited in claim 13, wherein packetsstored on each queue of the plurality of queues are processed in order.19. The system as recited in claim 13, wherein the first task identifiesthe first queue for enqueuing the continuation analysis task.